﻿@model ContactManagement.Models.EditUserAdminModel
@{
    ViewBag.Title = Resources.PageTitles.CreateUserRESX;
}
<h2>
    @Resources.PageTitles.CreateUserRESX</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm())
{
    <div class="@ViewBag.MessageType">
        @Html.ValidationSummary(true)
        @Html.ShowCustomMessage()
    </div>
    <fieldset>
        <legend>@Resources.Navigation.EditUserRESX</legend>
        <div class="view-item">
            <div class="editor-label">
                @Html.LabelFor(model => model.UserTitle)
            </div>
            <div class="editor-field">
                @Html.DropDownListFor(model => model.UserTitle, Model.UserTitles, Resources.GlobalStrings.PleaseSelectItemsRESX)
                @Html.ValidationMessageFor(model => model.UserTitle)
            </div>
        </div>
        <div class="clear-all" ></div>
        <div class="view-item">
            <div class="editor-label">
                @Html.LabelFor(model => model.UserName)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.UserName)
                @Html.ValidationMessageFor(model => model.UserName)
            </div>
        </div>
        <div class="clear-all" ></div>
        <div class="view-item">
            <div class="editor-label">
                @Html.LabelFor(model => model.Category)
            </div>
            <div class="editor-field">
                @Html.DropDownListFor(model => model.Category, Model.Categories, Resources.GlobalStrings.PleaseSelectItemsRESX)
                @Html.ValidationMessageFor(model => model.Category)
            </div>
        </div>
        <div class="clear-all" ></div>
        @* Um was für eine Art von Benutzer es sich handelt, kann nur von einem Admin oder SuperUser festgelegt werden! *@
        @if (CurrentSession.GetCurrentUser().IsAdminOrSuperUser())
        {
            <div class="view-item">
                <div class="editor-label">
                    @Html.LabelFor(model => model.UserType)
                </div>
                <div class="editor-field">
                    @Html.DropDownListFor(model => model.UserType, Model.UserTypes)
                    @Html.ValidationMessageFor(model => model.UserType)
                </div>
            </div>
            <div class="clear-all" ></div>
        }
        <div class="view-item">
            <div class="editor-label">
                @Html.LabelFor(model => model.IsActiveUser)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.IsActiveUser)
                @Html.ValidationMessageFor(model => model.IsActiveUser)
            </div>
        </div>
        <div class="clear-all" ></div>
        <div class="view-item">
            <div class="editor-label">
                @Html.LabelFor(model => model.Logintries)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Logintries)
                @Html.ValidationMessageFor(model => model.Logintries)
            </div>
        </div>
        <div class="clear-all" ></div>
        <div class="view-item">
            <div class="editor-label">
                @Html.LabelFor(model => model.Street)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Street)
                @Html.ValidationMessageFor(model => model.Street)
            </div>
        </div>
        <div class="clear-all" ></div>
        <div class="view-item">
            <div class="editor-label">
                @Html.LabelFor(model => model.ZipCode)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.ZipCode)
                @Html.ValidationMessageFor(model => model.ZipCode)
            </div>
        </div>
        <div class="clear-all" ></div>
        <div class="view-item">
            <div class="editor-label">
                @Html.LabelFor(model => model.City)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.City)
                @Html.ValidationMessageFor(model => model.City)
            </div>
        </div>
        <div class="clear-all" ></div>
        <div class="view-item">
            <div class="editor-label">
                @Html.LabelFor(model => model.HouseNumber)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.HouseNumber)
                @Html.ValidationMessageFor(model => model.HouseNumber)
            </div>
        </div>
        <div class="clear-all" ></div>
        <div class="view-item">
            <div class="editor-label">
                @Html.LabelFor(model => model.Firstname)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Firstname)
                @Html.ValidationMessageFor(model => model.Firstname)
            </div>
        </div>
        <div class="clear-all" ></div>
        <div class="view-item">
            <div class="editor-label">
                @Html.LabelFor(model => model.Lastname)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Lastname)
                @Html.ValidationMessageFor(model => model.Lastname)
            </div>
        </div>
        <div class="clear-all" ></div>
        <div class="view-item">
            <div class="editor-label">
                @Html.LabelFor(model => model.Handy)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Handy)
                @Html.ValidationMessageFor(model => model.Handy)
            </div>
        </div>
        <div class="clear-all" ></div>
        <div class="view-item">
            <div class="editor-label">
                @Html.LabelFor(model => model.Birthdate)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Birthdate)
                @Html.ValidationMessageFor(model => model.Birthdate)
            </div>
        </div>
        <div class="clear-all" ></div>
        <p>
            <br />
            <input type="submit" value="@Resources.Navigation.CreateUserRESX" />
        </p>
    </fieldset>
}
<div>
    @Html.ActionLink(Resources.Navigation.BackToListRESX, EActionUser.UserList.ToString())
</div>
